<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>User</title>
		<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
	</head>
	<body>
		
		<jsp:include page="common/header.jsp"/>
		
		<b><center>User  : 
		<%@page language="java" import="OnlineExam.login.*,registration.*, java.util.*, OnlineExam.*" %>
<%
	User user = (User) session.getAttribute("USER");
	List<Category> list = Category.selectAllCategories();
%>
<%=user.getEmailId()%></center></b>
		
		<br/><br/>
		<form action="TestHistory.jsp" method="get">
			<center>
				<input type="Submit" value=" View Test History">
			</center>
		</form>

		<form action="User.do" method="get">
		<center>
			<br><br>Choose A Category 
				<select name="Category">
					<option name="Choose" value="Category">Choose
<% 
   for (ListIterator iter = list.listIterator(); iter.hasNext();)
    {
		Category cat = (Category) iter.next();
%>
					<option name="<%=cat.getCategoryId()%>"><%=cat.getCategoryId()%>
<%	    
    }
%>
				</select>
		</center>
		
		<br /><br />
		
		<center>
			<input type="Submit" value="Take The Test">
		</center>
		
		</form>
		
		<br/><br/>
		
<%
	List listAdminCat = user.retrieveAdminCategories();
	if (listAdminCat.size() > 0)
	{
%>		
		<center>
			<form action="CategoryAdmin.jsp" method="get">
				<input type="Submit" value="Manage My Categories" />
			</form>
		</center>
<% 
	}
%>
<jsp:include page="common/footer.jsp"/>
	</body>
</html>
